repeat with h in ["ace_hearts", "ace_diamonds", "ace_clubs", "ace_spades", "king_hearts", "king_diamonds", "king_clubs", "king_spades"]
repeat with u = 1 to shuffledCards.count
if (shuffledCards[u].rank & "_" & shuffledCards[u].rank) <> h then
next repeat
end if
shuffledCards.deleteAt(u)
exit repeat
end repeat
end repeat
return shuffledCards
end
on makesymbol arg
return symbol(string(arg))
end
on getlist forthis
if (forthis >= 34) and (forthis <= 45) then
return tableau[makesymbol(forthis)].cards
end if
if (forthis >= 18) and (forthis <= 25) then
return foundation[makesymbol(forthis)].cards
end if
end
on checklose
repeat with shit = 34 to 45
if not sprite(shit).visible then
next repeat
end if
repeat with cakes = 22 to 25
if (getValue(sprite(shit).member.name) = (getValue(sprite(cakes).member.name) + 1)) and (getSuit(sprite(shit).member.name) = getSuit(sprite(cakes).member.name)) then
abort()
end if
end repeat
repeat with cakes = 18 to 21
if (getValue(sprite(shit).member.name) = (getValue(sprite(cakes).member.name) - 1)) and (getSuit(sprite(shit).member.name) = getSuit(sprite(cakes).member.name)) then
abort()
end if
end repeat
repeat with cakes = 34 to 45
if shit = cakes then
next repeat
end if
if sprite(cakes).visible = 0 then
next repeat
end if
if (not getdup(shit, cakes) and (getValue(sprite(shit).member.name) = (getValue(sprite(cakes).member.name) - 1))) or (getValue(sprite(shit).member.name) = (getValue(sprite(cakes).member.name) + 1)) or ((getValue(sprite(shit).member.name) = 1) and (getValue(sprite(cakes).member.name) = 13)) or ((getValue(sprite(shit).member.name) = 13) and (getValue(sprite(cakes).member.name) = 1)) then
abort()
end if
end repeat
end repeat
repeat with shit = 18 to 25
if not sprite(shit).visible then
next repeat
end if
repeat with cakes = 34 to 45
if sprite(cakes).visible = 0 then
next repeat
end if
if (getValue(sprite(shit).member.name) = (getValue(sprite(cakes).member.name) - 1)) or (getValue(sprite(shit).member.name) = (getValue(sprite(cakes).member.name) + 1)) or ((getValue(sprite(shit).member.name) = 1) and (getValue(sprite(cakes).member.name) = 13)) or ((getValue(sprite(shit).member.name) = 13) and (getValue(sprite(cakes).member.name) = 1)) then
abort()
end if
end repeat
end repeat
end
on gotoit
pootimer.forget()
go("gameover")
end
on getValue arg
if (arg contains "hearts") or (arg contains "spades") then
return getOff(chars(arg, 1, arg.length - 7))
else
if arg contains "diamonds" then
return getOff(chars(arg, 1, arg.length - 9))
else
if arg contains "clubs" then
return getOff(chars(arg, 1, arg.length - 6))
end if
end if
end if
end
on getOff numba
if numba = "ace" then
return 1
else
if numba = "two" then
return 2
else
if numba = "three" then
return 3
else
if numba = "four" then
return 4
else
if numba = "five" then
return 5
else
if numba = "six" then
return 6
else
if numba = "seven" then
return 7
else
if numba = "eight" then
return 8
else
if numba = "nine" then
return 9
else
if numba = "ten" then
return 10
else
if numba = "jack" then
return 11
else
if numba = "queen" then
return 12
else
if numba = "king" then
return 13
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end
on getSuit arg
if arg contains "hearts" then
return #hearts
else
if arg contains "diamonds" then
return #diamonds
else
if arg contains "clubs" then
return #clubs
else
if arg contains "spades" then
return #spades
end if
end if
end if
end if
end
on getdup arg, arg2
ass = 0
if tableau[string(arg).symbol].cards.count >= 2 then
if getOff(tableau[string(arg).symbol].cards[tableau[string(arg).symbol].cards.count - 1].rank) = getValue(sprite(arg2).member.name) then